{include file="public/header2" /}
<form action="{:url('/admin/blog/blog_edit/bid/'.$blog['blog_id'])}" method="post">
    <input type="hidden" name="blog_id" value="{$blog.blog_id}">
<div class="layui-form layuimini-form">
    <div class="layui-form-item">
        <label class="layui-form-label required">博客标题</label>
        <div class="layui-input-block">
            <input type="text" name="blog_title" lay-verify="required" lay-reqtext="博客标题不能为空" placeholder="请输入博客标题" value="{$blog.blog_title}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">博客分类</label>
        <div class="layui-input-block">
            <select lay-filter="aihao" name="category_id" >
                <option value="">请选择</option>
                {foreach $cate as $v}
                <option value="{$v.category_id}" {$blog['category_id']==$v['category_id']?'selected':''}>{$v.category_name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">所属会员</label>
        <div class="layui-input-block">
            <select  lay-filter="aihao"  name="admin_id">
                <option value="">请选择</option>
                {foreach $admin as $v}
                <option value="{$v.admin_id}" {$blog['admin_id']==$v['admin_id']?'selected':''}>{$v.admin_name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">发布时间</label>
        <div class="layui-input-block">
            <input type="date" name="blog_time"  value="{$blog.blog_time}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label  required">博客内容</label>
        <div class="layui-input-block">
            <textarea  class="layui-textarea" placeholder="请输入博客内容" name="blog_content">{$blog.blog_content}</textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" id="editBtn"  type="submit">确定编辑</button>
        </div>
    </div>
</div>
</form>
<script src="/static/admin/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/admin/layui/dist/layui.js" charset="utf-8"></script>
<script>
    layui.use(['util', 'laydate', 'layer'], function(){
        var util = layui.util
            ,laydate = layui.laydate
            ,$ = layui.$
            ,layer = layui.layer;
        //XSS 过滤
        $('#editBtn').on('click', function(){ //监听按钮事件
            var str = util.escape($('.layui-input').val()); //执行 xss 过滤方法
        });
        $('.layui-input').val(str);
    });
</script>
<!--<script>-->
<!--    layui.use(['form'], function () {-->
<!--        var form = layui.form,-->
<!--            layer = layui.layer,-->
<!--            $ = layui.$;-->

<!--        //监听提交-->
<!--        form.on('submit(saveBtn)', function (data) {-->
<!--            var index = layer.alert(JSON.stringify(data.field), {-->
<!--                title: '最终的提交信息'-->
<!--            }, function () {-->

<!--                // 关闭弹出层-->
<!--                layer.close(index);-->

<!--                var iframeIndex = parent.layer.getFrameIndex(window.name);-->
<!--                parent.layer.close(iframeIndex);-->

<!--            });-->

<!--            return false;-->
<!--        });-->

<!--    });-->
<!--</script>-->
</body>
</html>